{{--极光推送列表页--}}
@extends('admin.layouts.indexList')
@section('content')
    <div class="layui-card-header" style="padding-left: 0;">
        <a href="{{route('admin.home')}}" class="layui-btn">
            <i class="layui-icon"></i>
            新增
        </a>
    </div>
    <div class="layui-form">
        <table class="layui-table">
            <colgroup>
                <col width="3%">
                <col width="5%">
                <col width="5%">
                <col width="3%">
                <col width="10%">
                <col width="8%">
            </colgroup>
            <thead>
            <tr>
                <th>id</th>
                <th>头像</th>
                <th>名称</th>
                <th>地点</th>
                <th>简介</th>



                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($data as $k=>$v)
                <tr>
                    <td>{{$v->id}}</td>
                    <td>
                        <img width="100" src="{{env('IMGURL') . $v->pic_url}}" alt="">
                    </td>
                    <td>{{$v->name}}</td>
                    <td>{{$v->location}}</td>
                    <td>{{$v->synopsis}}</td>



                    {{--按钮组--}}
                    <td>
                        <div class="layui-btn-group">
                            {{--没有编辑，写错了直接删掉再新建--}}
                            <a href="{{route('admin.home',$v['id'])}}" style="" type="button"
                               class="layui-btn layui-btn-sm layui-btn-normal">
                                <i class="layui-icon"></i>
                                编辑
                            </a>
                            <a href="javascript:;" onclick="del({{$v['id']}},this)"  class="layui-btn layui-btn-sm layui-btn-danger">
                                <i class="layui-icon"></i>
                                删除
                            </a>
                            <form action="{{route('admin.home',$v['id'])}}" hidden method="post">
                                @csrf @method('DELETE')
                            </form>
                        </div>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
    {{--分页--}}
    {{$data->links()}}
@endsection

@section('index_script')
    <script>
        layui.use(['form', 'layedit', 'laydate','upload'], function(){
            var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate
                ,upload = layui.upload;

            form.render(); //更新全部
        });



    </script>
@endsection
